package com.example.gatewaytoken.controller;

import com.example.gatewaytoken.util.JWTUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author whx
 * @date 2022/4/13
 */
@RestController
public class TokenController {

    @PostMapping("/login/check")
    public String login(String userId,String password){
        if("admin".equals(userId) && "123456".equals(password)){
            return JWTUtil.generateToken(userId);
        }
        return "账号密码错误";
    }

}
